package com.demo.cn.retrofirdemo;

import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;

/**
 * Created by admin at 2018/6/4
 */

public interface ApiServices {

    @GET("service/2/auth/login?IMEI=99000693131945&DEVICE_VERSION=6.0.1&DEVICE_NAME=MI " +
            "4LTE&LOGIN_NAME=tangjiaqi&LOGIN_PWD=zxcv&MAC=02:00:00:00:00:00&DEVIVE_TYPE=android" +
            "&APP_VERSION=1.0&LOGIN_CRM=tangjiaqi")
    Call<String> getCall();


    /**
     *表明是一个表单格式的请求（Content-Type:application/x-www-form-urlencoded）
     * <code>Field("username")</code> 表示将后面的 <code>String name</code> 中name的取值作为 username 的值
     */
    @POST("service/2/auth/login")
    @FormUrlEncoded
    Call<String> doLogin(@Field("LOGIN_NAME") String name, @Field("LOGIN_PWD") String pwd);


    @Headers({"Content-Type:application/json","Accept:application/json"})//需要添加头
    @POST("service/2/getExpandDetail")
    Call<String> getExpandDetail(@Body RequestBody route);//传入的参数为RequestBody


}
